package com.google.code.coma.space;

import org.mozartspaces.capi3.Capi3Exception;
import org.mozartspaces.capi3.javanative.operation.NativeEntry;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

/**
 * This callback retrieves all entries which are present in the container
 *
 * @author Dominik Strasser, dominikstr@gmail.com
 */
public class SelectAllSelectorCallback implements SelectorCallback {
	@Override
	public List<NativeEntry> doInTransaction(Collection<NativeEntry> coordinatorCollection, CallContext callContext) throws Capi3Exception {
		if(coordinatorCollection==null)
			return new ArrayList<NativeEntry>();
		return new ArrayList<NativeEntry>(coordinatorCollection);
	}
}
